﻿@model dynamic
@{
    ViewBag.Title = L("部门管理");
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}
<div id="app">
    <i-form :model="department" :label-width="80">
        <Form-item label="名称">
            <i-input v-model="department.name" placeholder="请输入"></i-input>
        </Form-item>
        <Form-item label="排序号">
            <i-input v-model="department.orderNo" placeholder="请输入"></i-input>
        </Form-item>
        <Form-item>
            <i-button type="primary">提交</i-button>
            <i-button type="ghost" style="margin-left: 8px">取消</i-button>
        </Form-item>
    </i-form>
</div>
@section scripts{
    <script type="text/javascript">
        $(function () {
            var service = abp.services.app.departmentService;
            window.view = new Vue({
                el: "#app",
                data: {
                    department:{}
                },
                methods: {
                    remove: function (row) {
                        window.abp.message.confirm("确认删除？")
                            .done(function () {
                                service.remove({ id: row.id }).done(function () {
                                    service.getAll()
                                        .done(function (data) {
                                            view.rows = data.items;
                                        });
                                });
                            });
                    },
                    edit: function () {

                    }
                }
            });
            service.get({id:"@Request.QueryString["id"]"}).done(function(data) {
                view.department = data;
            });
        });
    </script>
}
